<template>
  <div class="app-container">
    <div class="user">
      <strong>{{ user.username }}</strong><br>
      <small>{{ user.roleName }}</small>
    </div>
    <el-row class="user-content" style="">
      <el-col :span="3" class="profile">
        <img class="user-avatar" src="@/assets/img/user.png" width="100"><br>
        <p><span class="title"><i class="el-icon-phone"></i>&nbsp;&nbsp;{{ user.phone }}</span></p>
        <p><span class="title"><i class="el-icon-message"></i>&nbsp;&nbsp;{{ user.email }}</span></p>
      </el-col>
      <el-col :span="21" style="padding-left:10px;">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="Personal Information" name="profile"></el-tab-pane>
          <el-tab-pane label="Change Password" name="updatePwd"></el-tab-pane>
        </el-tabs>

        <el-form ref="form" :model="form" label-width="150px" style="max-width: 400px" :rules="rules">
             <el-form-item label="Old Password" prop="oldPassword" style="margin-bottom:22px;">
                <el-input
                    show-password
                    clearable
                    minlength="8"
                    type="password"
                    v-model="form.oldPassword">
                </el-input>
              </el-form-item>
              <el-form-item label="New Password" prop="password" style="margin-bottom:22px;">
                <el-input
                    show-password
                    clearable
                    minlength="8"
                    type="password"
                    v-model="form.password">
                </el-input>
              </el-form-item>

              <el-form-item label="Confirm Password" prop="checkPassword" style="margin-bottom:22px;">
                <el-input
                    show-password
                    clearable
                    minlength="8"
                    type="password"
                    v-model="form.checkPassword">
                </el-input>
              </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="updatePwd">{{ $t('ship.button.submit') }}</el-button>
          </el-form-item>
        </el-form>
      </el-col>
    </el-row>


  </div>
</template>

<script src="./updatePwd.js"></script> 

<style rel="stylesheet/scss" lang="scss" scoped>
  @import "src/styles/common.scss";
</style>

